home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / util / rexx / Pixload-1.70.lha / Pixload-1.70 / Pixload-Prefs < prev    next >
Text File  |  1994-04-16  |  5KB  |  224 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6.  
  7. call init
  8. call CreateApp
  9. call Lecture
  10. call HandleApp
  11.  
  12. /************************************************/
  13. init: procedure expose nb nbicon
  14.  
  15.    l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  16.    if AddLibrary("rxmui.library")~=0 then exit
  17.    call RxMUIOpt("debugmode showerr")
  18.  
  19.    call open(chemin,"Pixload:Prefs/Pixload.prefs",'Read')
  20.         nbicon=readln(chemin)
  21.         nb=nbicon
  22.    close(chemin)
  23.  
  24.    return
  25.  
  26. /***********************************************************************/
  27. HandleApp: procedure expose nb nbicon
  28.  
  29.  
  30.     ctrl_c=2**12
  31.     do forever
  32.  
  33.         call NewHandle("app","h",ctrl_c)
  34.         if and(h.signals,ctrl_c)>0 then exit
  35.  
  36.         select
  37.            when h.event="QUIT" then exit
  38.            when h.event="DROPEVENT" then call DropFun(h.from,h.to)
  39.            otherwise interpret h.event
  40.         end
  41.     end
  42.  
  43.     /* never reached */
  44. /***********************************************************************/
  45. CreateApp: procedure expose nb nbicon
  46.  
  47.     app.Title="Pixload-Prefs"
  48.     app.Version="$VER: Pixload Prefs 1.70"
  49.     app.Author="Pixel Art - www.pixel-art.fr.st"
  50.     app.Base="Pixload-config"
  51.     app.SubWindow="win"
  52.  
  53.      win.ID="MAIN"
  54.      win.Title="Pixload's settings"
  55.  
  56.      win.Contents="mgroup"
  57.  
  58.     mgroup.0="tex"
  59.        tex.class="group"
  60.        tex.frame="group"
  61.        tex.columns=7
  62.  
  63.        tex.0=checkmark("large",0)
  64.  
  65.        tex.1="texx0"
  66.           texx0.class="text"
  67.           texx0.contents=Parsetext("%0Horizontal Pixload bar")
  68.  
  69.        tex.2="texx1"
  70.          texx1.class="numericbutton"
  71.          texx1.min=1
  72.          texx1.max=8
  73.          texx1.value=nbicon
  74.  
  75.        tex.3="texx2"
  76.          texx2.class="text"
  77.          texx2.contents=Parsetext("%0Number of icons")
  78.  
  79.        tex.4="texx3"
  80.          texx3.class="text"
  81.          texx3.contents=""
  82.          texx3.inputmode="relverify"
  83.          texx3.frame="button"
  84.  
  85.     mgroup.1="ctrlg"
  86.        ctrlg.class="group"
  87.        ctrlg.frame="group"
  88.        ctrlg.columns=4
  89.  
  90.      do i=0 to nbicon-1
  91.  
  92.          k=i*4
  93.          ctrlg.k="bm1."i
  94.          bm1.i.class="gfxpic"
  95.          bm1.i.ShortHelp=Parsetext("%cCliquer sur le petit bouton si c'est un script\nClick on this little button if is a script")
  96.          bm1.i.source="Pixload:icones/"i
  97.          bm1.i.transparent=1
  98.          bm1.i.scale=70
  99.          bm1.i.precision="image"
  100.          bm1.i.draw=1
  101.  
  102.          k=i*4+1
  103.          ctrlg.k="bm."i
  104.          bm.i=CheckMark("bm."i,0)
  105.        
  106.          k=i*4+2
  107.          ctrlg.k="popf."i
  108.          popf.i.class="popasl"
  109.          popf.i.ShortHelp='Programs'
  110.          popf.i.string=string("file."i,"f")
  111.  
  112.          k=i*4+3
  113.          ctrlg.k="gg."i
  114.          gg.i.class="group"
  115.          gg.i.ShortHelp=Parsetext("Help")
  116.           sa.i.CycleChain=1
  117.           gg.i.0=String("sa."i,"f")
  118.  
  119.     end
  120.  
  121.     if NewObj("APPLICATION","APP")>0 then exit
  122.  
  123.     call Notify("win","CloseRequest",1,"APP","ReturnID","quit")
  124.  
  125.     call Notify("texx3","selected",0,"app","Return","call Stocke(nb)")
  126.  
  127.     call Notify("texx1","value","everytime","app","return","call stocke(h.value)","triggerattr")
  128.  
  129.     call Notify("large","selected","everytime","app","Return","call Stocke(nb)")
  130.  
  131.     call set("win","open",1)
  132.  
  133. return
  134.  
  135. /***************************************/
  136. Lecture: procedure
  137.  
  138.     call open(chemin,"Pixload:Prefs/Pixload.prefs",'Read')
  139.  
  140.     nbicon=readln(chemin)
  141.  
  142.     fichier.num=readln(chemin)
  143.     call set(large,"selected",fichier.num)
  144.  
  145.     do num=0 while ~EOF(chemin)
  146.  
  147.        fichier.num=readln(chemin)
  148.  
  149.        if fichier.num~="" then do
  150.  
  151.           if fichier.num==1 then call set(bm.num,"selected",fichier.num)
  152.  
  153.              fichier.num=readln(chemin)
  154.              call set(file.num,"contents",fichier.num)
  155.  
  156.              fichier.num=readln(chemin)
  157.              call set(sa.num,"contents",fichier.num)
  158.        end
  159.  
  160.     end
  161.  
  162.     call close(chemin)
  163.     call set("app","sleep",0)
  164.  
  165. return
  166.  
  167.  
  168. /*--------------------------------*/
  169. Stocke: procedure expose nb nbicon
  170.  
  171. Parse arg nbb
  172.  
  173. call open(adresse,"Pixload:Prefs/Pixload.prefs",'Write')
  174.  
  175.      call WriteLN(adresse,nbb)
  176.      call WriteLN(adresse,xget("large","selected"))
  177.  
  178.      nbb=nbb-1
  179.  
  180.     do i=0 to nbb
  181.  
  182.        if i~>nbicon-1 then do
  183.  
  184.        call WriteLN(adresse,xget("bm."i,"selected"))
  185.        call WriteLN(adresse,xget("file."i,"contents"))
  186.        call WriteLN(adresse,xget("sa."i,"contents"))
  187.  
  188.        end
  189.  
  190.        else do
  191.  
  192.        call WriteLN(adresse,"")
  193.        call WriteLN(adresse,"")
  194.        call WriteLN(adresse,"")
  195.  
  196.        end
  197.  
  198.     end
  199.  
  200.     call set("texx3","contents",Parsetext("%c%0Save / Update"))
  201.  
  202.     nb=nbb+1
  203.  
  204.     call close(adresse)
  205.  
  206.     if show('P','PIXLOAD.1') then
  207.        do
  208.         address 'PIXLOAD.1'
  209.         address command 'copy ram:env/mui/pixload.1.prefs to sys:prefs/env-archive/mui/pixload.1.prefs'
  210.         Quit
  211.        end
  212.  
  213.     address command 'sys:c/wait sec=1'
  214.     address command 'sys:c/wbrun sys:wbstartup/Pixload'
  215.  
  216.  
  217. return
  218.  
  219. /*------------- */
  220. halt:
  221. break=_c:
  222. exit
  223.  
  224.